package myContacts;

import java.io.Serializable;

public class Email implements Serializable, Cloneable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String address;
	private String displayName;
	private String label;
	private boolean primary;
	private String quota;
	private String rel;
	
	private boolean on;
	
	public Email() {
		super();
		address = "";
		displayName = "";
		label= "";
		primary = false;
		quota = "";
		rel = "";
		on = false;
	}

	public boolean isOn() {
		return on;
	}

	public void setOn(boolean on) {
		this.on = on;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public boolean isPrimary() {
		return primary;
	}

	public void setPrimary(boolean primary) {
		this.primary = primary;
	}

	public String getQuota() {
		return quota;
	}

	public void setQuota(String quota) {
		this.quota = quota;
	}

	public String getRel() {
		return rel;
	}

	public void setRel(String rel) {
		this.rel = rel;
	}

	@Override
	protected Email clone() {
		// TODO Auto-generated method stub
		Email email = new Email();
		
		email.address = address;
		email.displayName = displayName;
		email.label= label;
		email.primary = primary;
		email.quota = quota;
		email.rel = rel;
		email.on = on;
		
		return email;
	}

	@Override
	public boolean equals(Object other) {
		
		if(other instanceof Email)
		{
			Email otherEmail = (Email) other;
			
			return (address.equals(otherEmail.address));
		}
		
		return false;
	}
	
}
